#pragma once

// Qt's
#include <QPushButton>
#include <QPaintEvent>
#include <QLabel>

// Custom's
#include "../gant_global_define.h"

class LoadingButtonPrivate;
class GANT_EXPORT LoadingButton : public QPushButton
{
    Q_OBJECT

public:
    explicit LoadingButton(QWidget* parent = nullptr);
    explicit LoadingButton(const QString& text, QWidget* parent = nullptr);
    ~LoadingButton();

    void setTimeout(int _timeout);
    int timeout() const;

    void setFinished();

protected:
    void mouseReleaseEvent(QMouseEvent* me) override;
    void timerEvent(QTimerEvent* te) override;

signals:
    void sgnTimeout();

private:
    GANT_DECL_PRIVATE(LoadingButton);
};
